package cn.s1995.sloth.bizs.mapper;

import java.time.LocalDateTime;
import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;

import cn.s1995.sloth.bizs.entity.Order;
import cn.s1995.sloth.bizs.oo.req.OrderListREQ;
import cn.s1995.sloth.bizs.oo.vo.OrderVO;
import cn.s1995.sloth.common.data.datascope.SlothBaseMapper;

@Mapper
public interface OrderMapper extends SlothBaseMapper<Order> {


    /**
     * 根据订单状态和时间查询订单和订单项
     * @param state 订单状态
     * @param lessThanUpdateTime 更新时间
     * @return
     */
    List<Order> getOrderAndOrderItems(@Param("state") Integer state,
                                      @Param("lessThanUpdateTime") LocalDateTime lessThanUpdateTime);

    /**
     * 查询包含退款状态的订单
     * @param page
     * @param req
     * @return
     */
	Page<OrderVO> getHasRefundOrderPage(@Param("page") Page page, @Param("req") OrderListREQ req);
}
